#pragma once

#include <cocos2d.h>
#include <tcCommon/tc_common.h>
#include <vector>

using namespace cocos2d;
using namespace std;


class PlayerListLayer : public CCLayer
{
public:
	PlayerListLayer();
	virtual ~PlayerListLayer();
	
	virtual bool init();
	static cocos2d::CCScene* scene();
	//virtual void menuCloseCallback(CCObject* pSender);
	LAYER_NODE_FUNC(PlayerListLayer);
	//virtual void draw();
	virtual void update(ccTime dt);
	virtual void onEnter();
	void refreshPlayerInfoCells();
	void freePlayerInfo();
	void copyPlayerInfo(char **user_list, BOOL *status, int user_number);
protected:
	//vector<CCSprite>
	void logoutCallBack(CCObject* pSender);
	void refreshCallBack(CCObject* pSender);
	void menuCallback(CCObject* pSender);
private:
	char **player_list;
	BOOL *ready_list;
	int player_count;
	CCMenu *m_pItemMenu;
public:
	bool need_refresh_list;
	bool new_challenger;
};
